<template>
    <div class="left">
        <h2>{{msg}}</h2>
        <button @click="send">发送给你兄弟</button>
    </div>
</template>

<script>
import pub from 'pubsub-js'
export default {
   data(){
     return{
        msg:'白日依山尽,黄河入海流'
     }
   },
   methods:{
    send(){
      pub.publish('shigekey',this.msg)
    }
   }
}
</script>

<style>
    .left{
        width: 100vw;
        height: 200px;
        background-color: springgreen;
    }
</style>